export function toResult(promise) {
    if (
      !promise ||
      Object.prototype.toString.call(promise) !== '[object Promise]'
    ) {
        
      return Promise.reject(new Error('requires promises as the param')).catch((err) => [err, null]);
    }
    return promise.then((...args) => [null, ...args]).catch((err) => [err, null]);
  }
  